Editing a behavior in a library item

When you create library items that contain elements with behaviors attached to them, Dreamweaver copies the element and its event handler (the attribute that specifies which event to look for and which action to call when the event occurs) to the library item file. Dreamweaver does not copy the associated JavaScript functions into the library item. Instead, Dreamweaver automatically inserts the functions into the HEAD section of the current document (if they do not already exist) when you add the library item to the document.

The JavaScript functions are not stored with the library item because they are HEAD elements, and library items can only contain BODY elements. Thus the Behavior inspector is unavailable when you are editing a library item, because only half of the behavior code is available to inspect. To edit a behavior in a library item, you must first make the item editable and then re-create it after making changes.

To edit a behavior in a library item:

1 Open a document that contains the library item.
Note the name of the library item, as well as the exact tags it contains. You'll need this information in steps 8 and 9.
2 Select the library item and click Detach from Original in the Property inspector.
3 Select the element that has the behavior attached to it.
4 Choose Window > Behaviors to open the Behavior inspector, and then double-click the action you want to change.
5 In the dialog box that appears, make the necessary changes and click OK.
6 Choose Window > Library to open the Library palette.
7 Delete the original library item.
8 In the Document window, select the elements that make up the library item.
Be careful to select exactly the same elements that were in the original library item.
9 In the Library palette, use the context menu to select Create Library Item, and give the new item the same name as the one you deleted in step 7.
Be sure to use exactly the same spelling and capitalization.
10 To update the library item in your site pages, do one of the following
Choose Modify > Library > Update Pages.
Use the context menu, then select Update Pages.
11 In the Update Pages dialog box, in the Look in pop-up menu, select Files That Use.
The name of the library item you just created should appear in the adjacent pop-up menu.
12 Select Update Library Items, and then click Start.
13 Click Close to exit the Update Pages dialog box.